<?php if(!empty($subvo)){
    $v = $subvo;
    $subvo = '';
}
if(!empty($subsubvo)){
    $v = $subsubvo;
    $subsubvo = '';
}
?>

<div class="viewBox myBox<?php echo $v['id'];?>" <?php if($_SESSION[C('USER_AUTH_KEY')]){?>sortID="<?php echo $v['sort'];?>"  id="" modulesID="<?php echo $v['id'];?>" title="<?php echo $v['title'];?>" deleteUrl="<?php echo U('/Admin/Modules/delete',array('id'=>$v['id']));?>" settingUrl="<?php echo U('/Admin/Modules/edit',array('id'=>$v['id']));?>" isEdit="0"<?php }?>>
  
 

  
  
  
  
  
  <div style="height:91%;"><div id="l-map<?php echo $v['id'];?>"></div>
<div id="r-result<?php echo $v['id'];?>"></div></div>
  
  
  
  
  
  <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=QMDvD2Anle2gLOINIBUZ1Lhh"></script>
  
  
  
  <script type="text/javascript">
	var lbsGeo = document.createElement('lbs-geo');
	lbsGeo.addEventListener("geofail",function(evt){ //注册事件
		alert("fail");
	});
	lbsGeo.addEventListener("geosuccess",function(evt){ //注册
		var addr = evt.detail.coords;
		var x = addr.lng;
		var y = addr.lat;
		//alert(x+','+y);
		var spoint = new BMap.Point(x,y);
		createmap(spoint);
	});
	lbsGeo.setAttribute("enable-modified","true");
	lbsGeo.setAttribute("id","geo");
	document.body.appendChild(lbsGeo);




function createmap(p){

	// 百度地图API功能
	var map = new BMap.Map("l-map<?php echo $v['id'];?>");
	map.centerAndZoom(new BMap.Point(<?php echo $v['baidupoint'];?>), 12);
	var epoint = new BMap.Point(<?php echo $v['baidupoint'];?>);
	
	var driving = new BMap.DrivingRoute(map, {renderOptions: {map: map, panel: "r-result<?php echo $v['id'];?>", autoViewport: true}});
	driving.search(p, epoint);
}
$(function(){
$("#geo").css({'position':'absolute','top':'0px','left':'0px','width':'100%'});
	
	
	
	});



</script>

  

</div>
